package strategy;

import strategy.vo.Ticket;

// 策略模式的主要目的是将算法的定义与使用分开，也就是将算法的行为和环境分开
public class App {
    public static void main(String[] args) {
        Ticket ticket = new Ticket(30, "动作片");
        Context c1 = new Context(ticket, new ConcreteStrategyOne());
        System.out.println("执行策略One后的价格为："+c1.calculate());
        Context c2 = new Context(ticket, new ConcreteStrategyTwo());
        System.out.println("执行策略Two后的价格为："+c2.calculate());

    }

}
